package Day10;

/**
 * @author HYHwtx
 * @version 1.0
 * @date 2022/2/16 11:19
 */
public class Demo11 {
    //数组的反转
    public static void main(String[] args) {
        int[]arr = {11,22,33,44,55,66};
        int temp = 0;
        int len = arr.length;//计算数组长度
        for (int i = 0; i < len / 2; i++) {
            temp = arr[len-1-i];//保存
            arr[len-1-i] = arr[i];
            arr[i] = temp;
        }
        System.out.println("反转后的结果");
        for (int i = 0; i < arr.length; i++) {
            System.out.print(arr[i]+"\t");
        }
    }
}
